﻿#!/usr/bin/env python3

import unicodedata

def main():
    '''
unicodedata -
提供了获取字符各种属性的方法, 诸如 
name, 
codepoint, 
digit, 
numeric, 
category, 
bidirectional, 
combining, 
east_asian_width
mirrored
decomposition
normalize

    '''
    print(main.__doc__)
    print("unicode verion=" + unicodedata.unidata_version)
    print(unicodedata.lookup('LEFT CURLY BRACKET'))
    print(unicodedata.name('/'))
    print(unicodedata.decimal('9'))
    try:
        print(unicodedata.decimal('a'))
    except ValueError as e:
        print(e)
    print(unicodedata.category('A'))  # 'L'etter, 'u'ppercase
    print(unicodedata.bidirectional('\u0660')) # 'A'rabic, 'N'umber
    print(unicodedata.name('大'))
    print(unicodedata.category('大'))
    print(unicodedata.east_asian_width('大'))
    print(unicodedata.east_asian_width('a'))
    




if __name__=='__main__':
    main()


